home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-30 | 5.9 KB | 264 lines | [TEXT/CWIE] |
- // =============================================================================
- //
- // >>> ⌐ 1996-1997 Microsoft Corporation. All rights reserved. <<<
- //
- // This is a mix-in class that provides your control with basic capabilities to
- // connect to the outgoing interface(s) of one or more controls.
- //
- // =============================================================================
-
- #ifndef _H_CBaseCPClient
- #define _H_CBaseCPClient
-
- //=-----------------------------------------------------------------------------
- // class declaration
- //=-----------------------------------------------------------------------------
-
- /*
- !CBaseCPClient();
- ªC ----- Provides connection capability to controls
- CBaseCPClient methods
-
- This is a mix-in class that provides your control with basic capabilities to
- connect to the outgoing interface(s) of one or more controls.
- */
-
-
- class CBaseCPClient
- {
- public:
- // *** CBaseCPClient methods ***
- CBaseCPClient(void);
- /* ñ1 Constructor
- ** INPUT:
- ** void
- */
-
-
- ~CBaseCPClient(void);
- /* ñ1 Destructor
- ** INPUT:
- ** void
- */
-
- virtual Boolean8 AddInterface(IID inInterfaceID);
- /* ñ1 CBaseCPClient method
- ** INPUT:
- ** IID the id of the interface to be added
- ** RETURNS:
- ** Boolean8 true - the interface was found
- ** false - the interface was not found
- **
- ** Add the specified interface to the incoming list. Indicates that this control
- ** wants to connect to all controls with a matching outgoing interface. If
- ** the interface is not found it is added to the list.
- */
-
-
- virtual Boolean8 AddSource(IID inInterfaceID, const Char8* inName);
- /* ñ1 CBaseCPClient method
- ** INPUT:
- ** IID the id of the interface whose source is being added
- ** const Char8 * the name of the interface
- ** RETURNS:
- ** Boolean8 false - source already in the list
- ** unable to allocate CBaseConnectionInfo class
- ** true - source successfully added
- **
- ** Add the specified source (control ID and interface) to the incoming list.
- ** Indicates that this control wants to connect to the specified interface
- ** of the specified control. <- should this be container???
- */
-
-
- virtual Boolean8 ConnectComplete(void);
- /* ñ1 CBaseCPClient method
- ** INPUT:
- ** void
- ** RETURNS:
- ** Boolean8 true - all the controls/interfaces have been found
- ** false - unable to find a control/interface we require
- **
- ** Determine if we found all the controls/interfaces to which we want to connect?
- */
-
-
- virtual void SetUpConnections(IUnknown* inClient, IContainer* inContainer);
- /* ñ1 CBaseCPClient method
- ** INPUT:
- ** IUnknown * the client
- ** IContainer * the container whose controls are being connected to
- ** RETURNS:
- ** void
- **
- ** Search the list of controls in the specified container and connect to the
- ** outgoing interfaces as appropriate.
- */
-
-
-
- private:
- Boolean8 AddDesiredSource(IID inInterfaceID, const Char8* inName);
- Uint32 CountOpenConnections(void);
- Boolean8 IsDesiredSource(IID inInterfaceID, const Char8* inName);
- Boolean8 IsFoundSource(IID inInterfaceID, const Char8* inName);
- Boolean8 IsSource(IID inInterfaceID, const Char8* inName);
- void SetUpControlConnection(IUnknown* inClient, IUnknown* inControl);
-
- LArray* mDesiredSources;
- LArray* mFoundSources;
- Boolean8 mClosing;
- };
-
- /*
- !CBaseConnectionInfo();
- ªC ----- Say something profound
- CBaseConnectionInfo methods
-
- ???? Body of class description
- */
-
-
- class CBaseConnectionInfo
- {
- public:
- // *** CBaseConnectionInfo methods ***
- CBaseConnectionInfo(void);
- /* ñ2 Constructor
- ** INPUT:
- ** void
- */
-
-
- CBaseConnectionInfo(IID inInterfaceID, const Char8* inSourceName);
- /* ñ2 Constructor
- ** INPUT:
- ** IID the interface
- ** const Char8 * the source name
- */
-
-
- ~CBaseConnectionInfo(void);
- /* ñ2 Destructor
- ** INPUT:
- ** void
- */
-
-
-
- virtual IID GetInterfaceID(void);
- /* ñ2 CBaseConnectionInfo method
- ** INPUT:
- ** void
- ** RETURNS:
- ** IID the interface id
- **
- ** Get a copy of the interface id.
- */
-
-
- virtual const Char8* GetSource(void);
- /* ñ2 CBaseConnectionInfo method
- ** INPUT:
- ** void
- ** RETURNS:
- ** const Char8 * the source name requested
- **
- ** Get a pointer to the source name.
- */
-
-
- virtual Boolean8 GetFound(void);
- /* ñ2 CBaseConnectionInfo method
- ** INPUT:
- ** void
- ** RETURNS:
- ** Boolean8 indicates whether ??? has been found
- **
- ** Determine whether ??? has been found.
- */
-
-
- virtual void SetInterfaceID(IID inInterfaceID);
- /* ñ2 CBaseConnectionInfo method
- ** INPUT:
- ** IID the interface id to be set
- ** RETURNS:
- ** void
- **
- ** Set the specified interface id.
- */
-
-
- virtual void SetSource(const Char8* inSource);
- /* ñ2 CBaseConnectionInfo method
- ** INPUT:
- ** const Char8 * the source name to be set
- ** RETURNS:
- ** void
- **
- ** Create or replace the source name.
- */
-
-
- virtual void SetFound(Boolean8 inFound);
- /* ñ2 CBaseConnectionInfo method
- ** INPUT:
- ** Boolean8 the new found value
- ** RETURNS:
- ** void
- **
- ** Set the found member.
- */
-
-
- virtual Boolean8 Connect(IUnknown* inClient, IConnectionPoint* inCP);
- /* ñ2 CBaseConnectionInfo method
- ** INPUT:
- ** IUnknown * the client to be connected to ???
- ** IConnectionPoint *
- ** RETURNS:
- ** Boolean8 true - connection succeeded
- ** false - connection failed
- **
- ** Connect to the specified client ???
- */
-
-
- virtual Boolean8 Disconnect(void);
- /* ñ2 CBaseConnectionInfo method
- ** INPUT:
- ** void
- ** RETURNS:
- ** Boolean8 true - disconnect succeeded
- **
- ** Disconnect from the client ???
- */
-
-
- virtual Boolean8 IsConnected(void);
- /* ñ2 CBaseConnectionInfo method
- ** INPUT:
- ** void
- ** RETURNS:
- ** Boolean8 true - you are connected
- ** false - you are not connected
- **
- ** Determine whether you are connected to the client or not ???
- */
-
-
-
- private:
- void CommonInit(void);
-
- IID mInterfaceID;
- Char8* mSourceName;
- IConnectionPoint* mConnectionPoint;
- Uint32 mCookie;
- Boolean8 mFound;
- Boolean8 mConnected;
- };
-
- #endif // _H_CBaseCPClient
-